package com.xjw.test;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.WString;
import com.sun.jna.ptr.IntByReference;

/**      
 * 项目名称：springMvc  
 * 实现功能：  
 * 类名称：TextJna   
 * 类描述：(该类的主要功能)
 * 创建人：徐纪伟 
 * E-mail: xujiwei558@126.com
 * 创建时间：Jul 22, 2014 9:21:34 AM   
 * 修改人：   
 * 修改时间：   
 * 修改备注：   
 * @version    
 */
public class TextJna {
	public interface CLibrary extends Library{
		CLibrary Instance=(CLibrary)Native.loadLibrary("Interop.DSOFramer",CLibrary.class);
		boolean GetUserNameA( byte[] name ,IntByReference size);  
		boolean Open(WString path, boolean b, String type, String s1, String s2);
	}
	
	public static void main(String[] args) {  
//	        try {  
//	            byte userName[] = new byte[100];  
//	            IntByReference size=new IntByReference(100);  
//	            boolean bool = CLibrary.Instance.GetUserNameA(userName, size);  
//	            System.out.println("Result:"+bool);  
//	            String uName = new String(userName);  
//	            System.out.println(uName);  
//	        } catch (Exception e) {  
//	            e.printStackTrace();  
//	        }  
		boolean bool = CLibrary.Instance.Open(new WString("D:\\20140715130740791.doc"), false, "Word.Document", "", "");
		System.out.println(bool);
	}  


}
